package com.sanyuan.cloud.module.system.enums.nongmo;

import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @Description: CommonEnums
 * @Author: wuyuwei
 * @Date: 2025/4/7
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum CommonEnums {
    /**
     * 拜访状态 0-未拜访 1-已拜访-无意向 2-已拜访-有意向 3-正在合作
     */
    VISIT_STATUS_0("0","未拜访"),
    VISIT_STATUS_1("1","已拜访-无意向"),
    VISIT_STATUS_2("2","已拜访-有意向"),
    VISIT_STATUS_3("3","正在合作"),

    /**
     * 业务状态（0-出发打卡 1-到达打卡）
     */
    BUSINESS_STATUS_0("0","出发打卡"),
    BUSINESS_STATUS_1("1","到达打卡"),
    ;

    private String code;
    private String name;

    public static String getNameByCode(String code) {
        if (StrUtil.isBlank(code)){
            return null;
        }
        for (CommonEnums value : CommonEnums.values()) {
            if (value.code.equals(code)) {
                return value.name;
            }
        }
        return null;
    }
}
